import 'package:get_it/get_it.dart';
import 'package:mobile_app.core/injection_container.dart' as core_di;
import 'package:mobile_app.core/purchases/domain/use_cases/obtain_purchased_items/use_case.dart';
import 'package:mobile_app.core/purchases/domain/use_cases/restore_purchased_items/use_case.dart';

final sl = GetIt.asNewInstance();

Future<void> init() async {
  // use cases

  sl.registerLazySingleton<ObtainPurchasedItems>(() {
    return ObtainPurchasedItemsImpl(
      googleAppleStoreApiService: core_di.sl(),
      getPremiumAccessInfoFromPurchasedItems: core_di.sl(),
      purchasedItemApiRepository: core_di.sl(),
      createPremiumAccessStatus: core_di.sl(),
      userSecureRepository: core_di.sl(),
      analyticsService: core_di.sl(),
      handleAccessCredentialUpdate: core_di.sl(),
      userRepository: core_di.sl(),
    );
  });

  sl.registerLazySingleton<RestorePurchasedItems>(() {
    return RestorePurchasedItemsImpl(
      googleAppleStoreApiService: core_di.sl(),
      getPremiumAccessInfoFromPurchasedItems: core_di.sl(),
      purchasedItemApiRepository: core_di.sl(),
      createPremiumAccessStatus: core_di.sl(),
      userSecureRepository: core_di.sl(),
      analyticsService: core_di.sl(),
      handleAccessCredentialUpdate: core_di.sl(),
      userRepository: core_di.sl(),
    );
  });
}
